/*
 * Client.h
 *
 *  Created on: Nov 5, 2012
 *      Author: lucas
 */

#ifndef CLIENT_H_
#define CLIENT_H_
#include "ClientReceivingThread.h"
#include "ClientSendingThread.h"
#include "GameThread.h"
#include <string>
class Mutex;
class Server;
class CommunicationSocket;

class Client {
private:
	Mutex m;
	CommunicationSocket* sck;
	ClientSendingThread* sendThread;
	ClientReceivingThread* recvThread;
	GameThread* gameThread;
	Server& server;
	bool connected;
public:
	Client(CommunicationSocket* csck, Server &s);
	virtual ~Client();
	void send(std::string& msg);
	bool isConnected();
	void disconnect();
	void join();
	void iniciar();
};

#endif /* CLIENT_H_ */
